<?php 
    $obj = TextLayoutPeer::retrieveByPk($text_module->getTextLayoutId());
    echo empty($obj) ? $text_module->getTextLayoutId() : image_tag($obj->getName() . '.png');
?>